<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html>
      <body>
        <h3>OData Services Test Result Summary</h3>
        <xsl:for-each select="ROOT//ExecutionSummary">
          <h4>
            ExecutionRunTime=<xsl:value-of select="@ExecutionRunTime"/>
            TotalTestCount=<xsl:value-of select="@TotalTestCount"/>
            Passed=<xsl:value-of select="@Passed"/>
            Failed=<xsl:value-of select="@Failed"/>
            Error=<xsl:value-of select="@Error"/>
          </h4>

        </xsl:for-each>
        <table border="1" >
          <tr bgcolor="#9acd32"  >
            <th>TestGUID</th>

            <th>ServiceRoot</th>
            <th>ServiceBusinessName</th>
            <th>EntityCollectionName</th>

            <th>EntityName</th>
            <th>TestName</th>

            <th>TestTitle</th>
            <th>StartTime</th>

            <th>EndTIme</th>
            <th>Duration (Min)</th>

            <th>HttpStatusCode</th>
            <th>TestResult</th>

            <th>QueryURL</th>
           
            <th>ErrorMessage</th>
            <th>errorTrace</th>
            <th>Output(Trimmed)</th>
          </tr>
          <xsl:for-each select="ROOT//Results/Result">
            <tr>
              <td>
                <xsl:value-of select="@TestGUID" />
              </td>
              <td>
                <xsl:value-of select="@ServiceRoot" />
              </td>
              <td>
                <xsl:value-of select="@ServiceBusinessName" />
              </td>
              <td>
                <xsl:value-of select="@EntityCollectionName" />
              </td>
              <td>
                <xsl:value-of select="@EntityName"/>
              </td>
              <td>
                <xsl:value-of select="@TestName"/>
              </td>


              <td>
                <xsl:value-of select="@TestTitle"/>
              </td>
              <td>
                <xsl:value-of select="@StartTime"/>
              </td>
              <td>
                <xsl:value-of select="@EndTIme"/>
              </td>

              <td>
                <xsl:value-of select="@Duration"/>
              </td>
              <td>
                <xsl:value-of select="@HttpStatusCode"/>
              </td>

              <td>
                <xsl:value-of select="@TestResult"/>
              </td>
              <td>
                <a>
                  <xsl:attribute name="href">
                    <xsl:value-of select="@QueryURL" />
                  </xsl:attribute>
                  <xsl:attribute name="target">_blank</xsl:attribute>
                  <xsl:value-of select="@QueryURL"/>
                </a>
               
              </td>
              <td>
                <xsl:value-of select="@ErrorMessage"/>
              </td>
              <td>
                <xsl:value-of select="@ErrorTrace"/>
              </td>
              <td>
                <xsl:value-of select="@Output"/>
              </td>
            </tr>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>
